package org.pas.fb2.tag;

public class SectionTag extends Tag {

    static final String NAME = "section";

    SectionTag(Tag parent) {
        super(parent);
    }

    @Override
    public String getName() {
        return NAME;
    }

    @Override
    public Tag onChild(String name) {
        if (TitleTag.NAME.equals(name)) {
            return new TitleTag(this);
        } else if (ParagraphTag.NAME.equals(name)) {
            return new ParagraphTag(this);
        } else if (SectionTag.NAME.equals(name)) {
            return new SectionTag(this);
        } else if (SubtitleTag.NAME.equals(name)) {
            return new SubtitleTag(this);
        } else if (EmptyLineTag.NAME.equals(name)) {
            return new EmptyLineTag(this);
        } else if (CiteTag.NAME.equals(name)) {
            return new CiteTag(this);
        } else if (EpigraphTag.NAME.equals(name)) {
            return new EpigraphTag(this);
        } else if (PoemTag.NAME.equals(name)) {
            return new PoemTag(this);
        } else if (ImageTag.NAME.equals(name)) {
            return new ImageTag(this);
        }
        return super.onChild(name);
    }

    @Override
    protected void doClose() {
        emptyLine(false);
    }
}
